package com.itheima.tlias.controller;

import com.itheima.tlias.comment.MyComment;
import com.itheima.tlias.service.ReportService;
import com.itheima.tlias.vo.EmpJobDataVo;
import com.itheima.tlias.vo.NameValueVo;
import com.itheima.tlias.vo.Result;
import com.itheima.tlias.vo.StudentClazzDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 报表
 */
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    @MyComment(desc = "视图  员工职位统计")
    @GetMapping("/empJobData")
    public Result<EmpJobDataVo> empJobData() {
        EmpJobDataVo empJobDataVo = reportService.empJobData();
        return Result.success(empJobDataVo);
    }
    @MyComment(desc = "视图  员工性别统计")
    @GetMapping("/empGenderData")
    public Result<List<NameValueVo>> empGenderData(){
        List<NameValueVo> nameValueVos = reportService.empGenderData();
        return Result.success(nameValueVos);
    }
    @MyComment(desc = "视图  班级人数统计")
    @GetMapping("/studentDegreeData")
    public Result<List<NameValueVo>> studentDegreeData(){
        List<NameValueVo> nameValueVos = reportService.studentDegreeData();
        return Result.success(nameValueVos);
    }
    @MyComment(desc = "视图  学员学历统计")
    @GetMapping("/studentCountData")
    public Result<StudentClazzDataVo> studentCountData(){
        StudentClazzDataVo studentClazzDataVo = reportService.studentCountData();
        return Result.success(studentClazzDataVo);
    }
}
